package ru.gerunn.test.jndi;

import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class Main {

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static void main(String[] args) throws NamingException {
		System.out.println(Context.INITIAL_CONTEXT_FACTORY);
		Hashtable environnement = new Hashtable();
		environnement.put(Context.INITIAL_CONTEXT_FACTORY, "ru.gerunn.test.jndi.MyContextFactory");

		Context ctx = new InitialContext(environnement);
		Object value = ctx.lookup("jndiName");
		ctx.close();

		System.out.println(value);
	}

}
